package com.niit.gams.controller;

import com.niit.gams.pojo.SysResource;
import com.niit.gams.pojo.TreeNode;
import com.niit.gams.service.SysResourceService;
import com.niit.gams.utils.TreeUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

/*
* 跳转页面使用
*/
@Controller
public class RenderController {

  @GetMapping("/toLogin")
  public String toLogin(){
    return "login";
  }

  @GetMapping({"/","/index"})
  public ModelAndView toIndex(){
    ModelAndView mav = new ModelAndView();
    mav.addObject("msg","hello shiro");
    mav.setViewName("index");
    return mav;
  }

  @GetMapping("/userlist")
  public String userslist() {
    return "users/userlist";
  }

  @GetMapping("/rolelist")
  public String roleslist() {
    return "roles/rolelist";
  }

  @GetMapping("/privlist")
  public String privslist() {
    return "privs/privlist";
  }

  @GetMapping("/unauthor")
  public String unauthorized() {

    return "unauthor";
  }
}
